package be.pluyckx.batteryprogress.activity.fragment.info.calculators;

import be.pluyckx.batteryprogress.activity.fragment.info.InfoFragment;
import be.pluyckx.batteryprogress.application.Constants;
import be.pluyckx.batteryprogress.utils.calculator.AverageRealTimeProgressCalculator;
import be.pluyckx.batteryprogress.utils.calculator.ProgressCalculator;

/**
 * Created by Philip Luyckx on 15/08/13.
 * <p/>
 * An InfoFragment that uses the AverageRealTimeProgressCalculator.
 */
public class AverageRealTimeInfoFragment extends InfoFragment {
  /**
   * A constructor that creates an @{link InfoFragment} using the {@link AverageRealTimeProgressCalculator}.
   */
  public AverageRealTimeInfoFragment() {
    super(new AverageRealTimeProgressCalculator(),
        new AverageRealTimeProgressCalculator.Parameters(
            ProgressCalculator.Parameters.ORDERED_OLD_LOWEST_INDEX,
            Constants.getAverageRealTimeCalculatorAmount()));
  }

  @Override
  public void onResume() {
    updateParameters(new AverageRealTimeProgressCalculator.Parameters(
        ProgressCalculator.Parameters.ORDERED_OLD_LOWEST_INDEX,
        Constants.getAverageRealTimeCalculatorAmount()));

    super.onResume();
  }
}
